// dialog
const { BaseBehavior, COMPONENT_OPTIONS } = require('../../mixins/component');

Component({
    behaviors: [BaseBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        show: {
            type: Boolean,
            value: false,
        },
        title: {
            type: String,
            value: '',
        },
        // 点击蒙层关闭
        maskClosable: {
            type: Boolean,
            value: true,
        },
        // 是否有蒙层
        mask: {
            type: Boolean,
            value: true,
        },
        isHaveOk: {
            type: Boolean,
            value: true,
        },
        isHaveCancel: {
            type: Boolean,
            value: false,
        },
        cancelText: {
            type: String,
            value: '取消',
        },
        okText: {
            type: String,
            value: '确定',
        },
        isDisable: {
            type: Boolean,
            value: false,
        },
    },
    data: {

    },
    methods: {
        cancelTap() {
            this.setData({
                show: false,
            });
            this.triggerEvent('cancel');
        },
        okTap() {
            this.triggerEvent('ok');
        },
    }
})

